package org.example.ioc.pro1;

import org.example.ioc.pro1.bean.Order;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class App3_annotations {
    public static void main(String[] args) {
        ApplicationContext context = new AnnotationConfigApplicationContext(AppConfig.class);
        Order order = context.getBean("order",Order.class);   // 这里的order是bean的id，Order.class是bean的类型  默认用类名小写    也可以用@Compoment("order")来指定bean的id
        System.out.println(order.toString());
    }
}
